from gssgca.transmission_line.cableway_selection import select_cableway
from gssgca.transmission_line.anchorage_design import design_ground_anchor
from gssgca.transmission_line.rigging_analysis import two_leg_sling
from gssgca.utils.construction_report import render_markdown_report


def main() -> None:
    scheme = select_cableway(span_m=380, payload_kN=150, terrain_category="mountain")
    anchor = design_ground_anchor(main_rope_tension_kN=scheme.main_rope_breaking_kN / 3.0, slope_deg=10, soil_allow_bearing_kPa=180)
    sling = two_leg_sling(load_kN=120, included_angle_deg=60)
    report = render_markdown_report("应急跨越方案估算", {
        "主绳直径(mm)": scheme.main_rope_diameter_mm,
        "主绳破断拉力(kN)": scheme.main_rope_breaking_kN,
        "估算安全系数": round(scheme.safety_factor, 2),
        "地锚埋深(m)": round(anchor.embed_depth_m, 2),
        "吊索单肢张力(kN)": round(sling.branch_tension_kN, 1),
    })
    print(report)


if __name__ == "__main__":
    main()


